<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        
        // function rand(min , max) {
        //     return parseInt(Math.random() * (max - min) + min)
        // }

        // 传参的时候，不管先后顺序   --- 无序性

        function rand(options) {
            // const {min , max} = options ;

            // 解构且赋默认值
            const {min = 0 , max = 10} = options ;
            console.log(min , max);
            return parseInt(Math.random() * (max - min) + min)
        }

        let res = rand({
            max : 100 ,
            // min : 20
        })

        console.log(res);

    </script>
    
</body>
</html>